/**    
 * Copyright by 深圳市共治物联科技有限公司 (c) 2023 Apple Inc.    
 * Date:${createTime}    
 */
package ${packageName};

import ${basePackageName}.mapper.entity.${ClassName}${setting.entPostfix};
import ${basePackageName}.service.${ClassName}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.github.pagehelper.PageInfo;
import com.lqfp.common.base.Page;
import com.lqfp.common.base.TResult;

/**
 * @description: ${comment}
 * @author: ${author}
 * @date: ${createTime}
 **/
@RestController
@RequestMapping("/admin/${className}/")
public class ${ClassName}Controller {

    @Autowired
    private ${ClassName}Service ${className}Service;
	/**
	 * @description: 分页查询${comment}
	 * @param: page
	 * @return: TResult<PageInfo<${ClassName}${setting.entPostfix}>> 
	 * @author: ${author}
	 * @date: ${createTime}
	 **/
    @PostMapping("page")
    public TResult<PageInfo<${ClassName}${setting.entPostfix}>> page(@RequestBody Page<${ClassName}${setting.entPostfix}> page) {
      return ${className}Service.page(page);
    }
	/**
	 * @description: 新增${comment}
	 * @param: ${className}${setting.entPostfix}
	 * @return: TResult<?> 
	 * @author: ${author}
	 * @date: ${createTime}
	 **/
    @PostMapping(value = "save")
    public TResult<?> save(@RequestBody ${ClassName}${setting.entPostfix} ${className}${setting.entPostfix}) {
        return ${className}Service.save(${className}${setting.entPostfix});
    }
	/**
	 * @description: 修改${comment}
	 * @param: ${className}${setting.entPostfix}
	 * @return: TResult<?> 
	 * @author: ${author}
	 * @date: ${createTime}
	 **/
    @PostMapping(value = "update")
    public TResult<?> update(@RequestBody ${ClassName}${setting.entPostfix} ${className}${setting.entPostfix}) {
        return ${className}Service.updateById(${className}${setting.entPostfix});
    }
	/**
	 * @description: 删除${comment}
	 * @param: id
	 * @return: TResult<?> 
	 * @author: ${author}
	 * @date: ${createTime}
	 **/
    @PostMapping(value = "delete")
    public TResult<?> delete(@RequestParam("id") String id) {
        return ${className}Service.removeById(id);
    }
}
